// 引入路由api
import {createRouter, createWebHashHistory} from 'vue-router'

// 引入页面
const Home = () => import('../views/Home.vue')
const About = () => import('../views/About.vue')

// 路由配置
const routes = [
    {path:'/', redirect:'/home'},
    {path:'/home', name:'home', component: Home},
    {path:'/about', name:'about', component: About},
]

// 创建路由实例
const router = createRouter({
    // 使用 hash模式
    history: createWebHashHistory(),
    // 传入路由的配置
    routes
})

export default router